var a = getApp();

Page({
    data: {
        tabArr: {
            curHdIndex: 2,
            curBdIndex: 0
        },
        wzif: !0,
        jia: "+",
        jian: "",
        currentResult: 0
    },
    particulars: function(a) {
        console.log(a.currentTarget.dataset.id), wx.setStorageSync("particularsid", a.currentTarget.dataset.id), 
        wx.navigateTo({
          url: "/hyb_yl/backstageServicess/pages/particulars/particulars"
        });
    },
    tab: function(a) {
        var t = a.currentTarget.id, e = {};
        e.curHdIndex = t, e.curBdIndex = t, this.setData({
            tabArr: e,
            currentResult: 0,
            wzif: !0,
            onFlag: !1
        }), this.onclick();
    },
    onLoad: function(a) {
        var t = this;
        wx.getSystemInfo({
            success: function(a) {
                t.setData({
                    height: .98 * a.windowHeight
                });
            }
        });
    },
    onShow: function() {
        this.setData({
            onFlag: !1
        }), this.onclick();
    },
    onclick: function(t) {
        this.setData({
            moreFlag: !1
        });
        var e = this, r = wx.getStorageSync("log") || "", o = wx.getStorageSync("teamId") || "";
        wx.request({
            url: a.globalData.dic + "doctor/team/moneyBagDetail",
            data: {
                token: r,
                currentResult: 0,
                teamId: o,
                type: e.data.tabArr.curHdIndex
            },
            success: function(a) {
                console.log(a.data.data), a.data.data.details || e.setData({
                    onFlag: !0
                }), e.setData({
                    arr: a.data.data.details,
                    currentResult: a.data.data.page.nextResult
                });
            }
        });
    },
    lower: function() {
        if (!this.data.moreFlag && !this.data.closureFlag) {
            this.setData({
                closureFlag: !0
            });
            var t = this, e = wx.getStorageSync("log") || "", r = wx.getStorageSync("teamId") || "";
            console.log(1111111111111);
            t.data.jia;
            var o, n = t.data.currentResult, s = t.data.arr;
            wx.request({
                url: a.globalData.dic + "doctor/team/moneyBagDetail",
                data: {
                    token: e,
                    currentResult: n,
                    teamId: r,
                    type: t.data.tabArr.curHdIndex
                },
                success: function(a) {
                    if (console.log(a), 200 == a.data.code) {
                        t.setData({
                            currentResult: a.data.data.page.nextResult
                        });
                        var e = a.data.data.details;
                        if (o = s.concat(e), console.log(a.data.data), console.log(e), console.log(o), null == e) return t.setData({
                            moreFlag: !0,
                            closureFlag: !1
                        }), !1;
                        wx.showLoading({
                            title: "加载中",
                            icon: "loading"
                        }), t.setData({
                            arr: o,
                            closureFlag: !1
                        }), setTimeout(function() {
                            wx.hideLoading();
                        }, 1500);
                    }
                }
            });
        }
    }
});